import request from '@/utils/request'
import { praseStrEmpty } from "@/utils/ruoyi";

// 新增策略
export function saveStrategy(data) {
  return request({
    url: '/trade/strategy/save',
    method: 'post',
    data: data
  })
}

// 删除策略
export function removeStrategy(strategyIds) {
  return request({
    url: '/trade/strategy/remove/' + strategyIds,
    method: 'delete'
  })
}

// 修改策略
export function updateStrategy(data) {
  return request({
    url: '/trade/strategy/update',
    method: 'put',
    data: data
  })
}

// 查询策略详细
export function getStrategy(strategyId) {
  return request({
    url: '/trade/strategy/' + praseStrEmpty(strategyId),
    method: 'get'
  })
}

// 查询策略列表
export function searchStrategy(query) {
  return request({
    url: '/trade/strategy/search',
    method: 'get',
    params: query
  })
}